/*LICENSE_BEGIN
 * ******************************************************************
 * Copyright 2006 by the Dainamite Robocup-Team at the
 * DAI-Labor, TU-Berlin (www.dai-labor.de)
 * 
 * Members of Dainamite are:
 * Holger Endert
 * Robert Wetzker
 * Thomas Karbe
 * Axel Heßler
 * Philippe Bütter
 * Felix Brossmann
 * 
 * Licensed under the GNU GPL (General Public License) Free Software 
 * License, Version 2. You may use this file only in compliance with 
 * the License. You may obtain a copy of the License at:
 * 
 * http://www.fsf.org/licensing/licenses/gpl.txt
 * ******************************************************************
LICENSE_END*/
package robocup.component.actions;

/**
 * A move action is used to set a player directly to a certain position. This 
 * can be done in playmode before-kickoff by each player himself, of by the 
 * goalie at most twice within his penalty area after catching the ball.
 */
public class MoveAction extends Action {
	
	/**
	 * The x-coordinate, the which the player should be moved.
	 */
	private int _x;

	/**
	 * The y-coordinate, the which the player should be moved.
	 */
	private int _y;

	/**
	 * Returns the actions string representation:
	 * @return 
	 * (move &lt;x&gt; &lt;y&gt;)<br><br>
	 */
	@Override
	public String toString() {
		StringBuffer buf = new StringBuffer();
		buf.append("(move ");
		buf.append(this._x);
		buf.append(" ");
		buf.append(this._y);
		buf.append(")");

		return buf.toString();
	}

	/**
	 * Constructor - action to move the player
	 * 
	 * @param x
	 *            the x-coordinate of the move
	 * @param y
	 *            the y-coordinate of the move
	 */
	public MoveAction(int x, int y) {
		this._x = x;
		this._y = y;
		this._type = TYPE.MOVE;
	}

	/**
	 * @return Returns the x.
	 */
	public int getX() {
		return this._x;
	}

	/**
	 * @return Returns the y.
	 */
	public int getY() {
		return this._y;
	}
}
